package Com.HupochuanAdmin.Dal.Tab;

import java.util.Hashtable;
import java.util.List;
import java.util.Vector;

import Com.Hupochuan.Dal.DBManager.DBManager;
import Com.Hupochuan.Vo.SourceType;

public class SourceTypeTab {
	/*
	 * 本类私有对象
	 */
	private DBManager<SourceType> dbManager = new DBManager<SourceType>(SourceType.class);
	
	/*
	 * 单一实例
	 */
	private SourceTypeTab(){}
	private static SourceTypeTab sourceTypeTab = new SourceTypeTab();
	public static SourceTypeTab getObject(){
		return sourceTypeTab;
	}
	
	/*
	 * 获得资源类型列表
	 */
	public List<SourceType> findSourceTypeList(){
		//参数部分
		List<SourceType> sourceTypeList = new Vector<SourceType>();
		StringBuffer sqlBuff = new StringBuffer();
		Hashtable<String,Object> paraHash = new Hashtable<String,Object>();
		
		//sql语句部分
		sqlBuff.append(" select * from SourceType ");
		sqlBuff.append(" order by weight desc,id ");
		
		//执行sql 
		sourceTypeList = this.dbManager.querySqlReturnVoList(sqlBuff.toString(),paraHash);
		
		//返回列表
		return sourceTypeList;
	}
}
